Skip to content

[codex] Improve dynamic worker error formatting#241

Closed
heyglassy wants to merge 3 commits intoRhysSullivan:mainfrom
heyglassy:codex/dynamic-worker-error-formatting
Closed

[codex] Improve dynamic worker error formatting#241
heyglassy wants to merge 3 commits intoRhysSullivan:mainfrom
heyglassy:codex/dynamic-worker-error-formatting

Conversation

@heyglassy
Copy link
Copy Markdown
Contributor

@heyglassy heyglassy commented Apr 14, 2026

Summary

  • prevent object-shaped dynamic worker errors from collapsing to [object Object]
  • preserve normal Error.message behavior for standard errors
  • add regression coverage for thrown objects and object-shaped tool failures in the Cloudflare dynamic worker tests

Root Cause

The dynamic worker runtime formatted execution failures with err.message ?? String(err). When sandboxed code or a tool failure threw a plain object, that fell through to String(err) and surfaced as [object Object].

Validation

  • cd packages/kernel/runtime-dynamic-worker && bun x vitest run src/invocation.test.ts --reporter=verbose
  • cd packages/kernel/runtime-dynamic-worker && bun x vitest run src/executor.test.ts --reporter=verbose

Screenshot Context

image CleanShot 2026-04-14 at 11 46 39@2x

Keep namespace inputs permissive during typing so underscores do not disappear from the Executor Cloud add-source forms. Manual namespace edits now preserve in-progress boundary underscores in the UI, while each add flow still canonicalizes the submitted namespace before saving.

Also extract the pure namespace helper logic into a small shared module so the underscore regression is covered by a focused Vitest test without pulling in the URL parsing dependency tree.

Verification:
- bun x vitest run tests/source-identity.test.ts

Notes:
- A previous attempt to import the helper from the full source-identity module failed locally because that module depends on tldts; the regression test now targets the extracted pure helper module directly.
Right-align the cancel and submit buttons in the inline secret creation forms so the actions sit on the trailing edge of the panel. Also replace the primary button label text from "Create & use" to "Create and use" in both the shared secret-header auth UI and the Google Discovery inline secret form for consistency.

Verification:
- inspected the updated JSX in the affected components
Prevent object-shaped execution and tool errors from collapsing to [object Object] in the Cloudflare dynamic worker runtime. Preserve normal Error.message behavior, JSON-serialize plain thrown objects, and update the runtime tests to cover both cases. Verified with bun x vitest run in packages/kernel/runtime-dynamic-worker.
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 14, 2026

Open in StackBlitz

@executor/sdk

npm i https://pkg.pr.new/RhysSullivan/executor/@executor/sdk@241

@executor/plugin-file-secrets

npm i https://pkg.pr.new/RhysSullivan/executor/@executor/plugin-file-secrets@241

@executor/plugin-google-discovery

npm i https://pkg.pr.new/RhysSullivan/executor/@executor/plugin-google-discovery@241

@executor/plugin-graphql

npm i https://pkg.pr.new/RhysSullivan/executor/@executor/plugin-graphql@241

@executor/plugin-keychain

npm i https://pkg.pr.new/RhysSullivan/executor/@executor/plugin-keychain@241

@executor/plugin-mcp

npm i https://pkg.pr.new/RhysSullivan/executor/@executor/plugin-mcp@241

@executor/plugin-onepassword

npm i https://pkg.pr.new/RhysSullivan/executor/@executor/plugin-onepassword@241

@executor/plugin-openapi

npm i https://pkg.pr.new/RhysSullivan/executor/@executor/plugin-openapi@241

@executor/plugin-workos-vault

npm i https://pkg.pr.new/RhysSullivan/executor/@executor/plugin-workos-vault@241

commit: 1708d1f

@heyglassy heyglassy marked this pull request as ready for review April 14, 2026 18:47
@heyglassy heyglassy marked this pull request as draft April 14, 2026 18:48
@heyglassy
Copy link
Copy Markdown
Contributor Author

Superseded by #244, which redoes this work as a clean refactor from main with a structured Effect-cause transport instead of the minimal stringification fix.

@heyglassy heyglassy closed this Apr 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant